import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { User } from "../user/user.entity";

@Entity()
export class Logs {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  path: string;

  @Column()
  method: string;

  @Column({nullable: true})
  data: string;

  @Column()
  result: number;

  @ManyToOne(() => User, (user) => user.roles)
  @JoinColumn({ name: "userId" })
  user: User;
}
